import React,{Component} from 'react';
import Cheader from './component/City/cHeader.js';
import Csearch from './component/City/cSearch.js';
import Citys from './component/City/citys.js';

class City extends Component {
    
    constructor(props){
        super(props);
        this.state={
            seletedCity:''
        }

    }

    handleChildChange(cityName){
      if(cityName){
        this.setState({
            seletedCity:cityName
        },function(){
            console.log(this.state.seletedCity)
        })
      }
    };
    render () {
        return (
            <div>
               <Cheader/>
               <Csearch/>
               <Citys onChange={this.handleChildChange.bind(this)}/>
            </div>
        )
    }
}

export default City;